﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;

namespace NCLCustomerManagement.DataTransferObjects
{
    public partial class DailySaleDTO : INotifyPropertyChanging, INotifyPropertyChanged
    {

        private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);

        private System.Guid _Id;

        private System.DateTime _SaleDate;

        private int _ProductId;

        private int _CustomerId;

        private decimal _SaleUnitPrice;

        private double _Quantity;

        private string _Notes;

      

        #region Extensibility Method Definitions
        partial void OnLoaded();
        partial void OnValidate(System.Data.Linq.ChangeAction action);
        partial void OnCreated();
        partial void OnIdChanging(System.Guid value);
        partial void OnIdChanged();
        partial void OnSaleDateChanging(System.DateTime value);
        partial void OnSaleDateChanged();
        partial void OnProductIdChanging(int value);
        partial void OnProductIdChanged();
        partial void OnCustomerIdChanging(int value);
        partial void OnCustomerIdChanged();
        partial void OnSaleUnitPriceChanging(decimal value);
        partial void OnSaleUnitPriceChanged();
        partial void OnQuantityChanging(double value);
        partial void OnQuantityChanged();
        partial void OnNotesChanging(string value);
        partial void OnNotesChanged();
        #endregion

        public DailySaleDTO()
        {
           
            OnCreated();
        }

        public System.Guid Id
        {
            get
            {
                return this._Id;
            }
            set
            {
                if ((this._Id != value))
                {
                    this.OnIdChanging(value);
                    this.SendPropertyChanging();
                    this._Id = value;
                    this.SendPropertyChanged("Id");
                    this.OnIdChanged();
                }
            }
        }

        public System.DateTime SaleDate
        {
            get
            {
                return this._SaleDate;
            }
            set
            {
                if ((this._SaleDate != value))
                {
                    this.OnSaleDateChanging(value);
                    this.SendPropertyChanging();
                    this._SaleDate = value;
                    this.SendPropertyChanged("SaleDate");
                    this.OnSaleDateChanged();
                }
            }
        }

        public int ProductId
        {
            get
            {
                return this._ProductId;
            }
            set
            {
                if ((this._ProductId != value))
                {
                   
                    this.OnProductIdChanging(value);
                    this.SendPropertyChanging();
                    this._ProductId = value;
                    this.SendPropertyChanged("ProductId");
                    this.OnProductIdChanged();
                }
            }
        }

        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_CustomerId", DbType = "Int NOT NULL")]
        public int CustomerId
        {
            get
            {
                return this._CustomerId;
            }
            set
            {
                if ((this._CustomerId != value))
                {
                  
                    this.OnCustomerIdChanging(value);
                    this.SendPropertyChanging();
                    this._CustomerId = value;
                    this.SendPropertyChanged("CustomerId");
                    this.OnCustomerIdChanged();
                }
            }
        }

        public decimal SaleUnitPrice
        {
            get
            {
                return this._SaleUnitPrice;
            }
            set
            {
                if ((this._SaleUnitPrice != value))
                {
                    this.OnSaleUnitPriceChanging(value);
                    this.SendPropertyChanging();
                    this._SaleUnitPrice = value;
                    this.SendPropertyChanged("SaleUnitPrice");
                    this.OnSaleUnitPriceChanged();
                }
            }
        }

        public double Quantity
        {
            get
            {
                return this._Quantity;
            }
            set
            {
                if ((this._Quantity != value))
                {
                    this.OnQuantityChanging(value);
                    this.SendPropertyChanging();
                    this._Quantity = value;
                    this.SendPropertyChanged("Quantity");
                    this.OnQuantityChanged();
                }
            }
        }

        public string Notes
        {
            get
            {
                return this._Notes;
            }
            set
            {
                if ((this._Notes != value))
                {
                    this.OnNotesChanging(value);
                    this.SendPropertyChanging();
                    this._Notes = value;
                    this.SendPropertyChanged("Notes");
                    this.OnNotesChanged();
                }
            }
        }

       
        public event PropertyChangingEventHandler PropertyChanging;

        public event PropertyChangedEventHandler PropertyChanged;

        protected virtual void SendPropertyChanging()
        {
            if ((this.PropertyChanging != null))
            {
                this.PropertyChanging(this, emptyChangingEventArgs);
            }
        }

        protected virtual void SendPropertyChanged(String propertyName)
        {
            if ((this.PropertyChanged != null))
            {
                this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
}
